Todo 表示の session.todo() API 移行#23
Merged
Merged
Conversation
…#15) - Add getSessionTodos() method to OpenCodeConnection - Add sessionTodos / getSessionTodos message protocol - Handle todo.updated SSE event for real-time updates - Remove latestTodos derivation from useMessages hook - Update TodoHeader and AppContext to use SDK Todo type - Fetch todos on session activation, clear on session deselect - Update scenario tests for new API-based Todo flow
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
Todo 表示のデータソースを、メッセージストリームからの
todowrite/todoreadツールパート逆順パースから、専用のsession.todo()SDK API +todo.updatedSSE イベントに移行する。Closes #15
背景
従来は
useMessagesフック内で全メッセージを末尾から走査し、todowrite/todoreadツールパートの出力をparseTodos()でパースして Todo リストを導出していた。session.todo()API はセッションの Todo リストを直接取得する専用エンドポイントであり、パースロジックを回避してより信頼性の高い方法で Todo を取得できる。変更内容
Extension Host 側
opencode-client.ts:Todo型の re-export、getSessionTodos()メソッド追加chat-view-provider.ts:getSessionTodos/sessionTodosメッセージプロトコル追加Webview 側
vscode-api.ts:sessionTodos(Ext→Webview) /getSessionTodos(Webview→Ext) メッセージ型追加App.tsx:todosstate 追加、todo.updatedSSE イベントハンドリング、セッション切替時の Todo フェッチuseMessages.ts:latestTodosの useMemo 導出ロジックとparseTodosimport を削除AppContext.tsx:latestTodosの型をTodoItem→ SDKTodoに変更TodoHeader.tsx: Props 型を SDKTodoに変更テスト
11-todo.test.tsx:sessionTodosメッセージとtodo.updatedSSE イベントベースのテストに書き換え。セッション切替クリア・別セッション無視・activeSession再送時の維持テストを追加useMessages.test.ts: 削除されたlatestTodos関連テスト 2 件を除去後方互換性
TodoView(ツールパート内のインライン表示)とparseTodosユーティリティは変更なしチェックリスト
npm run buildパスnpm testパス(52 ファイル / 710 テスト)